const Koa = require('koa');
const router = require('koa-router')();

const app = new Koa();

router.all('/', async (ctx, next) => {
  ctx.body = '/';
  await next();
});

router.all('/:_app', async (ctx, next) => {
  console.log(ctx);
  ctx.body = `/${ctx.params._app}`;
  await next();
});

app.use(router.routes());
app.use(router.allowedMethods());

app.listen(3000, () => {
  console.log('监听 http://localhost:3000');
})